import { $http } from './index';
import blobReq from './blobReq';

export function getPlanList(data = {}) {
    // 门禁类型子类型
    // return $http.get(`/saas/common/loadCommonParams?paramKey=${paramKey}`, data);
    return $http.post('/saas/order/plan/getList', data);
}

export function getSourceList(params = {}) {
    return $http.get('/saas/order/plan/getSourceList', { params });
}

export function cancelPlan(planId = null) {
    return $http.put(`/saas/order/plan/cancel?planId=${planId}`);
}

export function getJoinSignApproval(data = {}) {
    return $http.post('/saas/joining-trader/join-sign-approval/archive/list', data);
}

export function getSecondTradeList(params = {}) {
    return $http.get('/saas/trade/list/second', { params });
}

export function savePlan(data = {}) {
    return $http.post('/saas/order/plan/saveInfo', data);
}

export function getSelected(data = {}) {
    return $http.post('/saas/order/premises/getSelected', data);
}

export function getUnselected(data = {}) {
    return $http.post('/saas/order/premises/getUnselected', data);
}

export function getAll(params = {}) {
    return $http.get('/saas/order/premises/getAll', { params });
}

export function addBuilding(data = {}) {
    return $http.post('/saas/order/premises/add', data);
}
export function deleteBuilding(data = {}) {
    return $http.post('/saas/order/premises/delete', data);
}

export function getMachines(data = {}) {
    return $http.post('/saas/order/point/getMachines', data);
}

export function confirmIdeas(data = {}) {
    return $http.post('/saas/order/plan/creative/confirm', data);
}

export function getPlanInfo(params = {}) {
    return $http.get('/saas/order/plan/getInfo', { params });
}

export function preorder(data = {}) {
    return $http.post('/saas/order/point/preorder', data);
}

export function getCustomer(data = {}) {
    return $http.post('/saas/joining-trader/customer/pin-mei/list ', data);
}

export function clearSelected(data = {}) {
    return $http.post('/saas/order/point/clearSelected ', data);
}

export function kickOutPoint(data = {}) {
    return $http.post('/saas/order/point/kickOut ', data);
}

export function addPoint(data = {}) {
    return $http.post('/saas/order/point/addTo ', data);
}

export function exportSelected(params = {}) {
    return $http.get('/saas/order/point/exportSelected', { params });
}

export function exportKickedList(params = {}) {
    return blobReq.get('/saas/order/point/exportKickedList', { params });
}

export function exportSelectedMap(params = {}) {
    return blobReq.get('/saas/order/point/exportSelectedMap', { params });
}
export function exportPlan(data = {}) {
    return blobReq.post('/saas/order/plan/exportList', data);
}

export function getKickedList(params = {}) {
    return $http.get('/saas/order/point/getKickedList', { params });
}

export function lockPoint(params = {}) {
    return $http.get('/saas/order/point/lock', { params });
}

export function cancelSelected(data = {}) {
    return $http.post('/saas/order/point/cancelSelected', data);
}

export function clearKickedList(params = {}) {
    return $http.get('/saas/order/point/clearKickedList', { params });
}

export function analysisPoint(data = {}) {
    return $http.post('/saas/order/point/analysis', data);
}

export function getZtinfo(params = {}) {
    return $http.get('/saas/order/plan/zt', { params });
}

export function importPremises(data = {}) {
    return $http.post('/saas/order/premises/import', data);
}
export function exportFailPremises(params = {}) {
    return blobReq.get('/saas/order/premises/fail/export', { params });
}
export function planDisassemble(data = {}) {
    return $http.post('/saas/order/plan/disassemble', data);
}
// 方案恢复
export function getRecoverList(data = {}) {
    return $http.post('/saas/order/plan/recover', data);
}
// 补回点位
export function getCoverList(data = {}) {
    return $http.post('/saas/order/point/cover', data);
}

//下拉框查询方案
export function getPlanListSelector(data = {}) {
    return $http.post('/saas/order/plan/selector', data);
}

//上传照片
export function uploadPhoto(data = {}) {
    return $http.post('/saas/msp/photo/upload', data);
}

//上传照片-batch
export function uploadPhotoBatch(data = {}) {
    return $http.post('/saas/publishing/photo/feedback', data);
}

//上传照片错误信息
export function uploadPhotoBatchError(data = {}) {
    return $http.post('/saas/excel/callback/photo-batch-upload-error', data);
}
